package com.zzl.bonds.ticket.constant.status;

/**
 * 合同状态
 * 未完成	0
 * 已完成	1
 * 已拒绝	2
 * 正在签署	3
 * 锁定待签	4
 * 有争议	5
 * 已过期	9
 *
 * @author : gull
 * @date : 2022/2/16 15:02
 */
public enum ContractStateEnum {

    CONTRACT_STATUS_UNFINISHED(0, "未完成"),
    CONTRACT_STATUS_FINISHED(1, "已完成"),
    CONTRACT_STATUS_REFUSE(2, "已拒绝"),
    CONTRACT_STATUS_SIGNING(3, "正在签署"),
    CONTRACT_STATUS_LOCK(4, "锁定待签"),
    CONTRACT_STATUS_CONTROVERSIAL(5, "有争议"),
    CONTRACT_STATUS_EXPIRED(9, "已过期"),
    ;


    private final Integer code;
    private final String value;


    ContractStateEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getStatusName(Integer code) {
        for (ContractStateEnum value : ContractStateEnum.values()) {
            if (value.code.equals(code)) {
                return value.value;
            }
        }
        return null;
    }
    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
